import request from '@/utils/request'



export function getLoginUrl() {
  return request({
    url: '/user/getLoginUrl',
    method: 'get',
    // params: { token }
  })
}



export function login(code) {
  return request({
    url: '/user/login',
    method: 'post',
    data: {
      code
    }
  })
}

export function updateOrg(companyId,deptId) {
  return request({
    url: '/user/update/orgInfo',
    method: 'post',
    data: {
      companyId : companyId,
      deptId : deptId
    }
  })
}

export function getInfo() {
  return request({
    url: '/user/info',
    method: 'post',
    // params: { token }
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}


export function loginerp(sso_service_ticket) {
  var params =null;
  if(sso_service_ticket){
    params = {sso_service_ticket};
  }
  return request({
    url: '/user/valid_erp',
    method: 'post',
    params: params
  })
}

